package kr.hkit.powerjava.chapter24.work;

import java.io.Serializable;

import kr.hkit.powerjava.chapter22.work4.vo.Depatment;

public class Department implements Serializable, Comparable<Department> {
	private int deptNo;
	private String deptName;
	private int floor;
	public Department(int deptNo, String deptName) {
		this.deptNo = deptNo;
		this.deptName = deptName;
	}
	public Department(int deptNo, String deptName, int floor) {
		this.deptNo = deptNo;
		this.deptName = deptName;
		this.floor = floor;
	}
	@Override
	public int compareTo(Department o) {
		
		return deptNo-o.deptNo;
	}
	@Override
	public boolean equals(Object obj) {
		boolean result = false;
		if(obj instanceof Department){
			Depatment temp = (Depatment) obj;
			result = (deptNo == temp.deptNo && deptName.equals(temp.deptName));
		}
		return result;
	}
	
	

}
